{% load auth_extras %} {# Load custom template tags if you create them #}
<!DOCTYPE html>
<html>
  <head>
    <title>{% block title %}DataCharts{% endblock %}</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="/static/libs/tablers/tabler.min.css" rel="stylesheet" />
    <style>
      body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
      }

      .navbar .navbar-nav .nav-link {
        padding-left: 16px;
        padding-right: 16px;
      }
      .navbar-brand a {
        color: #333333;
        text-decoration: none;
      }

      .content {
        flex: 1;
      }

      .page-wrapper {
        overflow-y: auto;
        overflow-x: hidden;
      }

      .page-body {
        padding-top: 20px;
        box-sizing: border-box;
        margin-top: 0 !important;
      }

      .container-xl {
        width: 100% !important;
        height: 100% !important;
      }
    </style>
    {% block extra_css %}{% endblock %}
  </head>
  <body>
    <div class="page">
      <header class="navbar navbar-expand-md d-print-none">
        <div class="container-xl">
          <!-- BEGIN NAVBAR LOGO -->
          <div class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-md-3">
            <a href="/">青少年社交网络可视化分析系统</a>
          </div>
          <!-- END NAVBAR LOGO -->
          <div class="navbar-nav flex-row order-md-last">
            {% if request.user.is_authenticated %}
            <div class="nav-item dropdown">
              <a href="#" class="nav-link d-flex lh-1 p-0 px-2" data-bs-toggle="dropdown" aria-label="Open user menu">
                <span class="avatar avatar-sm" style="background-image: url(./static/avatars/000m.jpg)"> </span>
                <div class="d-none d-xl-block ps-2">
                  <div class="mt-1 small text-secondary">{{ request.user.username }}</div>
                </div>
              </a>
              <div class="dropdown-menu dropdown-menu-end dropdown-menu-arrow">
                <div class="dropdown-divider"></div>
                <a href="/logout/" class="dropdown-item">Logout</a>
              </div>
            </div>
            {% endif %}
          </div>
        </div>
      </header>
      {% if request.user.is_authenticated %}
      <header class="navbar-expand-md">
        <div class="collapse navbar-collapse" id="navbar-menu">
          <div class="navbar">
            <div class="container-xl">
              <div class="row flex-column flex-md-row flex-fill align-items-center">
                <div class="col">
                  <!-- BEGIN NAVBAR MENU -->
                  <ul class="navbar-nav">
                    <!-- 首页 -->
                    <li class="nav-item">
                      <a class="nav-link" href="/">
                        <span class="nav-link-icon d-md-none d-lg-inline-block"
                          ><!-- Download SVG icon from http://tabler.io/icons/icon/home -->
                          <svg
                            xmlns="http://www.w3.org/2000/svg"
                            width="24"
                            height="24"
                            viewBox="0 0 24 24"
                            fill="none"
                            stroke="currentColor"
                            stroke-width="2"
                            stroke-linecap="round"
                            stroke-linejoin="round"
                            class="icon icon-1"
                          >
                            <path d="M5 12l-2 0l9 -9l9 9l-2 0" />
                            <path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7" />
                            <path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6" /></svg
                        ></span>
                        <span class="nav-link-title"> 首页 </span>
                      </a>
                    </li>
                    {% if request.user.is_superuser %}
                    <!-- 数据管理 -->
                    <li class="nav-item">
                      <a class="nav-link" href="/supper/data/">
                        <span class="nav-link-title"> 数据管理 </span>
                      </a>
                    </li>
                    <li class="nav-item">
                      <a class="nav-link" href="/supper/users/">
                        <span class="nav-link-title"> 用户管理 </span>
                      </a>
                    </li>
                    {% endif %} {% if not request.user.is_superuser %}
                    <!-- 基本数据分析 -->
                    <li class="nav-item {% if navname == 'basic' %}active{% endif %}">
                      <a class="nav-link" href="/analysis/basic/">
                        <span class="nav-link-title"> 基本数据分析 </span>
                      </a>
                    </li>
                    <!-- 数据分析 -->
                    {% comment %} 如果 navname 为 "interests", 添加 active class {% endcomment %}
                    <li class="nav-item {% if navname == 'interests' %}active{% endif %}">
                      <a class="nav-link" href="/analysis/interests/">
                        <span class="nav-link-title"> 体育活动分析 </span>
                      </a>
                    </li>
                    <!-- 音乐喜好分析 -->
                    <li class="nav-item {% if navname == 'music' %}active{% endif %}">
                      <a class="nav-link" href="/analysis/personality/">
                        <span class="nav-link-title"> 音乐喜好分析 </span>
                      </a>
                    </li>
                    <!-- 宗教信仰分析 -->
                    <li class="nav-item {% if navname == 'religious' %}active{% endif %}">
                      <a class="nav-link" href="/analysis/religious/">
                        <span class="nav-link-title"> 宗教信仰分析 </span>
                      </a>
                    </li>
                    <!-- 时尚偏好分析 -->
                    <li class="nav-item {% if navname == 'fashion' %}active{% endif %}">
                      <a class="nav-link" href="/analysis/fashion/">
                        <span class="nav-link-title"> 时尚偏好分析 </span>
                      </a>
                    </li>
                    <li class="nav-item {% if navname == 'risk' %}active{% endif %}">
                      <a class="nav-link" href="/analysis/risk/">
                        <span class="nav-link-title"> 风险行为分析 </span>
                      </a>
                    </li>
                    <li class="nav-item">
                      <a class="nav-link" href="/dashboard/" target="_blank">
                        <span class="nav-link-title"> 数据大屏 </span>
                      </a>
                    </li>
                    <!-- 如果 navname 为 "correlation", 添加 active class -->
                    {% comment %}
                    <li class="nav-item {% if navname == 'correlation' %}active{% endif %}">
                      <a class="nav-link" href="/analysis/correlation/">
                        <span class="nav-link-title"> 相关性分析 </span>
                      </a>
                    </li>
                    {% endcomment %} {% endif %}
                  </ul>
                  <!-- END NAVBAR MENU -->
                </div>
                <div class="col col-md-auto">
                  <ul class="navbar-nav">
                    {% comment %}
                    <li class="nav-item">
                      <a class="nav-link" href="#" data-bs-toggle="offcanvas" data-bs-target="#offcanvasSettings">
                        <span class="badge badge-sm bg-red text-red-fg">New</span>
                        <span class="nav-link-icon d-md-none d-lg-inline-block">
                          <!-- Download SVG icon from http://tabler.io/icons/icon/settings -->
                          <svg
                            xmlns="http://www.w3.org/2000/svg"
                            width="24"
                            height="24"
                            viewBox="0 0 24 24"
                            fill="none"
                            stroke="currentColor"
                            stroke-width="2"
                            stroke-linecap="round"
                            stroke-linejoin="round"
                            class="icon icon-1"
                          >
                            <path
                              d="M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z"
                            />
                            <path d="M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" />
                          </svg>
                        </span>
                        <span class="nav-link-title"> Settings </span>
                      </a>
                    </li>
                    {% endcomment %}
                  </ul>
                </div>
              </div>
            </div>
          </div>
        </div>
      </header>
      {% endif %}
      <div class="page-wrapper">
        <div class="page-body">
          <div class="container-xl">
            {% if messages %} {% for message in messages %}
            <div class="alert alert-{{ message.tags }} alert-dismissible" role="alert">
              <div>{{ message }}</div>
              <a class="btn-close" data-bs-dismiss="alert" aria-label="close"></a>
            </div>
            {% endfor %} {% endif %} {% block content %} {% endblock %}
          </div>
        </div>
      </div>
    </div>

    <script src="/static/libs/tablers/tabler.min.js"></script>
    {% block extra_js %}{% endblock %}
  </body>
</html>
